package com.devilvan.betrice.europeacademy.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serial;
import java.io.Serializable;

/**
 * @Description 欧洲学术成员 履历 映射
 * @author Evad.Wu
 * @date 2022-09-05
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "EUROPE_ACADEMY_RESUME")

@Entity
@Table(name = "EUROPE_ACADEMY_RESUME")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "欧洲学术成员 履历 映射")
public class EuropeAcademyResumePo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = 6861664631929269971L;

    @Schema(description = "成员ID")
    @TableField(value = "MEMBERSHIP_ID")
    @Column(name = "MEMBERSHIP_ID", columnDefinition = "BIGINT(20) NOT NULL COMMENT '成员ID'")
    private Long membershipId;

    @Schema(description = "履历描述")
    @TableField(value = "RESUME")
    @Column(name = "RESUME", columnDefinition = "TEXT COMMENT '履历描述'")
    private String resume;

    @Schema(description = "欧洲学术成员主体")
    @TableField(exist = false)
    @ManyToOne(targetEntity = EuropeAcademyHeaderPo.class, cascade = CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinColumn(name = "MEMBERSHIP_ID",referencedColumnName = "MEMBERSHIP_ID",insertable = false,updatable = false)
    private EuropeAcademyHeaderPo europeAcademyHeaderPo;
}
